package org.example.feign;

import org.example.bean.Product;
import org.example.feign.fallback.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(value = "service-product",fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {

    @GetMapping(value = "/getProduct/{id}")
    Product getProduct(@PathVariable("id") String id,@RequestHeader("token") String token);

    @GetMapping(value = "/getProductList")
    List<Product> getProductList();

    @GetMapping(value = "/getFallbackTest")
    List<Product> getFallbackTest();

}
